<template>
  <div>
    <el-menu-item v-for="item in list" :key="item.id" :index="item.html" v-if="item.subFunction.length===0">
      <i :class="item.icon"/>
      <span slot="title">{{item.name}}</span>
    </el-menu-item>
    <el-submenu :key="item.id" :index="item.id.toString()" v-else>
      <template slot="title">
        <i :class="item.icon"/>
        <span>{{item.name}}</span>
      </template>
      <subItem :list="item.subFunction"></subItem>
    </el-submenu>
  </div>
</template>

<script>
import subItem from '@/components/subItem.vue'
export default {
  name: "subItem",
  props: {
    list: []
  },
  components: {
    subItem
  }
}
</script>

<style scoped>

</style>